package code18_design.factory;

public class WaterFactory {
	/**
	 * 生产指定类型的水
	 * @param type 类型
	 * @return 
	 */
	public static Water produce(int type) {
		Water w = null;
		// 根据 type, 生产不同的水
		switch (type) {
		case 1:
			w = new Water1();
			break;
		case 2:
			w = new Water2();
			break;
		case 3:
			w = new Water3();
			break;
		default:
			break;
		}
		return w;
	}
}
